<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <!-- Data Tables -->
    <link href="css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">
    <link href="css/plugins/dataTables/dataTables.responsive.css" rel="stylesheet">
    <link href="css/plugins/dataTables/dataTables.tableTools.min.css" rel="stylesheet">
    <link href="css/animate.css" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="css/css.css" />
</head>
<body style="background-color: white">
	<div class="pageTop" style="position: relative; height: 50px">
		<div class="page">
			<img src="img/coin02.png" /><span><a href="main.do">首页</a>&nbsp;-&nbsp;-</span>&nbsp;<a
				href="aftersaleinfo.do">售后日志管理</a>
		</div>
	</div>
	<div class="row">
		<div class="col-lg-12">
			<div class="ibox float-e-margins">
				<div class="ibox-title">
					<button class="userbtn"
						onclick="window.location.href='aftersaleinfoadd.do'"
						style="border-radius: 15px; font-size: 10px; color: #fff; background-color: #47a4e1; width: 80px; height: 40px;">新增售后日志</button>
				</div>
				<div class="ibox-content">
					<table class="table table-striped table-bordered table-hover "
						id="editable">
						<thead>
							<tr>
								<th style="text-align: center">编号</th>
								<th style="text-align: center">售后标题</th>
								<th style="text-align: center">机构名称</th>
								<th style="text-align: center">售后类型</th>
								<th style="text-align: center">处理人</th>
								<th style="text-align: center">重要级别</th>
								<th style="text-align: center">发布日期</th>
								<th style="text-align: center">处理状态</th>
								<th style="text-align: center">操作</th>
							</tr>
						</thead>
						<tbody>
							<c:forEach items="${sessionScope.aftersales }" var="aftersale">
								<tr class="gradeX">
									<td>${aftersale.id }</td>
									<td>${aftersale.title }</td>
									<td>${aftersale.organization.name }</td>
									<td><c:if test="${aftersale.type ==1}">售后处理</c:if> <c:if
											test="${aftersale.type ==2}">培训推广</c:if> <c:if
											test="${aftersale.type ==3}">其他</c:if></td>
									<td>${aftersale.transactor }</td>
									<td><c:if test="${aftersale.importantlevel ==1}">一般</c:if>
										<c:if test="${aftersale.importantlevel ==2}">重要</c:if> <c:if
											test="${aftersale.importantlevel ==3}">非常重要</c:if></td>
									<td><fmt:formatDate value="${aftersale.endtime }"
											pattern="yyyy-MM-dd" /></td>
									<td><c:if test="${aftersale.dealstate ==1}">未处理</c:if> <c:if
											test="${aftersale.dealstate ==2}">处理中</c:if> <c:if
											test="${aftersale.dealstate ==3}">已处理</c:if></td>
									<td>
											<a href="aftersaleinfoupdate.do?id=${aftersale.id }"><img class="operation" src="img/update.png"></a> 
											<a href="aftersaleinfodetail.do?id=${aftersale.id }"><img class="operation" src="img/view.png"></a>
											<a href="aftersaleinfodel.do?id=${aftersale.id }" onclick="if(confirm('确定删除?')==false)return false;"><img src="img/delete.png"></a>
									</td>
								</tr>

								<div class="banDel"
									style="width: 460px; height: 350px; background-color: rgba(0, 0, 0, 0); margin-top: 100px; margin-left: 500px; padding: 0;">
									<div class="delete"
										style="width: 460px; height: 250px; margin: 0; padding: 0; border: 2px solid rgba(0, 0, 0, 0.08); background-color: white">
										<div class="close">
											<a><img src="img/shanchu.png" /></a>
										</div>
										<p class="delP1" style="margin-top: 60px;">你确定要删除此条记录吗？</p>

										<p class="delP2">
											<a href="aftersaleinfodel.do/${emp.id }" class="ok yes">确定</a><a
												class="ok no">取消</a>
										</p>
									</div>
								</div>
							</c:forEach>
						</tbody>
					</table>
				</div>
			</div>
		</div>
	</div>
	</div>
	</div>
	</div>


	<!-- Mainly scripts -->
	<script src="js/jquery-2.1.1.js"></script>
	<script src="js/bootstrap.min.js"></script>
	<script src="js/plugins/metisMenu/jquery.metisMenu.js"></script>
	<script src="js/plugins/slimscroll/jquery.slimscroll.min.js"></script>

	<!-- Data Tables -->
	<script src="js/plugins/dataTables/jquery.dataTables.js"></script>
	<script src="js/plugins/dataTables/dataTables.bootstrap.js"></script>
	<script src="js/plugins/dataTables/dataTables.responsive.js"></script>


	<!-- Custom and plugin javascript -->
	<script src="js/inspinia.js"></script>

	<!-- Page-Level Scripts -->
	<script>
		$(document)
				.ready(
						function() {
							$('.dataTables-example')
									.dataTable(
											{
												responsive : true,
												"dom" : 'T<"clear">lfrtip',
												"tableTools" : {
													"sSwfPath" : "js/plugins/dataTables/swf/copy_csv_xls_pdf.swf"
												}
											});

							/* Init DataTables */
							var oTable = $('#editable').dataTable();

							/* Apply the jEditable handlers to the table */
							oTable
									.$('td')
									.editable(
											'../example_ajax.php',
											{
												"callback" : function(sValue, y) {
													var aPos = oTable
															.fnGetPosition(this);
													oTable.fnUpdate(sValue,
															aPos[0], aPos[1]);
												},
												"submitdata" : function(value,
														settings) {
													return {
														"row_id" : this.parentNode
																.getAttribute('id'),
														"column" : oTable
																.fnGetPosition(this)[2]
													};
												},

												"width" : "90%",
												"height" : "100%"
											});

						});

		function fnClickAddRow() {
			$('#editable').dataTable()
					.fnAddData(
							[ "Custom row", "New row", "New row", "New row",
									"New row" ]);

		}
		$(".delban").click(function() {
			$(".banDel").show();
		});
		$(".close").click(function() {
			$(".banDel").hide();
		});
		$(".no").click(function() {
			$(".banDel").hide();
		});
	</script>

</body>
</html>
